<template>
    <!-- 主题类型：视频；左文右图，视频分享页其它相关视频专用 -->
    <div class="list-video-small-component-item">
        <div class="list-video-small-component-item-bob">
            <router-link class="list-video-small-component-title"
                         :to="{name: 'Audio', params: { audioId: info.contentId}}">
                <span v-if="info.content.name">{{info.content.name}}</span>
                <span v-if="info.content.contentName">{{info.content.contentName}}</span>
            </router-link>
            <div class="single-component-takeup"></div>
            <router-link class="list-video-small-component-info"
                         :to="{name: 'Index', params: {channelid: info.content.channelId}}">
                <div class="list-video-small-component-info-name">
                    <img src="../assets/images/tag_audio_icon.png" style="height:1rem;vertical-align: bottom;">&nbsp;{{info.content.channelName}}
                </div>
                <div class="list-video-small-component-info-time"> {{info.content.displayTime &&
                    this.toCommonTime(info.content.displayTime)}}
                </div>
                <!--<div class="list-video-small-component-info-num">{{info.content.viewCount}}看过</div>-->
                <div class="clearBoth"></div>
            </router-link>
        </div>
        <router-link class="list-video-small-component-img"
                     :to="{name: 'Audio', params: { audioId: info.contentId}}">
            <!-- 视频的封面部分 -->
            <img v-if="info.content.stills"
                 v-lazy="info.content.stills + '?cmd=imageprocess/processtype/2/quality/100/width/500'"/>
            <img v-else src="../assets/images/live_default.png"/>
            <div class="list-video-small-component-img-btn">
                <img src="../assets/images/list_audio_icon.png"/>
            </div>
            <!--<div class="list-video-small-component-img-time">-->
            <!--<span v-if="info.content.vLength">{{this.getVideoTime(info.content.vLength)}}</span>-->
            <!--<span v-if="info.content.videoDuration">{{this.getVideoTime(info.content.videoDuration)}}</span>-->
            <!--</div>-->
        </router-link>
        <div class="clearBoth"></div>
    </div>
</template>

<script>
    export default {
        props: {
            info: {
                type: Object,
                default: function () {
                    return {};
                }
            },
            isBig: {
                type: Boolean,
                default: true
            }
        },
        watch: {
            '$route' (to, from) {
                //刷新参数放到这里里面去触发就可以刷新相同界面了
                if (to.name == from.name) {
                    window.location.href = to.path;
                }
            }
        }
    }
</script>

<style>

    .list-video-small-component-item {
        padding: 0.4rem 0;
        margin: 0.4rem auto;
        border-top: 1px solid #EDEDED;
        position: relative;
        padding-right: 7.2rem;
        height: 5.4rem;
        box-sizing: border-box;
    }

    .list-video-small-component-item-bob {
        width: 100%;
    }

    .list-video-small-component-title {
        display: block;
        font-size: 1.0rem;
        line-height: 1.3rem;
        height: 2.6rem;
        /*max-height: 3.5rem;*/
        color: #444444;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        /*white-space: nowrap;*/
        text-decoration: none;
    }

    .list-video-small-component-info {
        display: block;
        font-size: 0.64rem;
        line-height: 1.1rem;
        color: #999999;
    }

    .list-video-small-component-info-name {
        float: left;
        width: 65%;
        padding-right: 5px;
        box-sizing: border-box;
        color: #B3B3B3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .list-video-small-component-info-time {
        float: left;
        width: 35%;
        box-sizing: border-box;
        text-align: right;
        color: #B3B3B3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding-right: 0.3rem;
    }

    /*   .list-video-small-component-info-num {
           float: right;
           width: 25%;
           padding-left: 5px;
           box-sizing: border-box;
           text-align: right;
           overflow: hidden;
           text-overflow: ellipsis;
           white-space: nowrap;
       }
   */
    .list-video-small-component-img {
        display: block;
        width: 6.9rem;
        height: 4.6rem;
        /* float: right; */
        position: absolute;
        right: 0;
        top: 0.4rem;
    }

    .list-video-small-component-img img {
        width: 100%;
        height: 100%;
        position: absolute;
        left: 0;
        top: 0;
        object-fit: cover;
    }

    .list-video-small-component-img-btn {
        position: absolute;
        width: 1.6rem;
        height: 1.6rem;
        left: 50%;
        top: 50%;
        margin-left: -0.8rem;
        margin-top: -0.8rem;
    }

    .list-video-small-component-btn img {
        width: 100%;
        height: 100%;
    }

    /*.list-video-small-component-img-time {*/
    /*position: absolute;*/
    /*padding: 0 0.3rem;*/
    /*height: 1.4rem;*/
    /*background-color: #000;*/
    /*opacity: 0.7;*/
    /*color: #FFF;*/
    /*font-size: 0.9rem;*/
    /*line-height: 1.4rem;*/
    /*text-align: center;*/
    /*border-radius: 0.4rem;*/
    /*right: 0.4rem;*/
    /*bottom: 0.4rem;*/
    /*}*/
</style>